//
//  GSDKComplatform+Game.m
//  GameSDK
//
//  Created by Johnny on 2017/7/28.
//  Copyright © 2017年 Johnny. All rights reserved.
//

#import "GSDKComplatform+Game.h"
#import "GSDKComplatformBase.h"
#import "GSDKCommonMethod.h"
#import "YYKit.h"
#import "GSDKServicesManager.h"
@implementation GSDKComplatform (Game)
- (void)saveServerWithServerId:(nonnull NSString *)sid
                 andServerName:(nonnull NSString *)sName
                     andRoleId:(nonnull NSString *)roleid
                   andRoleName:(nonnull NSString *)roleName
                  andRoleLevel:(nonnull NSString *)roleLevel {
    if ([self isLogin]) {
        GSDKCOMMONMETHOD.GSDKSid = sid;
        NSDictionary * game_ext = @{@"server_id": sid, @"server_name": sName, @"role_id": roleid, @"role_name": roleName, @"role_level": roleLevel};
        GSDKCOMMONMETHOD.game_ext = game_ext;
        GSDKSelectServerModel * model = [[GSDKSelectServerModel alloc] initWithToken:GSDKCOMMONMETHOD.GSDKToken andGameExt:[game_ext modelToJSONString]];
        [[GSDKServicesManager new] oneTimeRequest:model andCompletionBlock:^(id responseObject) {
            DEBUGMSG(@"responseObject = %@", responseObject);
        }];
    }
}
@end
